-- 象棋试水之作
-- require了这个模块的话，应该返回engine？需要讨论

local engine_klass = require "packages.chess-games.nchess.core.engine"

local Rook = require "packages.chess-games.nchess.core.pieces.rook"
local Knight = require "packages.chess-games.nchess.core.pieces.knight"
local Bishop = require "packages.chess-games.nchess.core.pieces.bishop"
local Queen= require "packages.chess-games.nchess.core.pieces.queen"
local King   = require "packages.chess-games.nchess.core.pieces.king"
local Pawn   = require "packages.chess-games.nchess.core.pieces.pawn"

local Ch = engine_klass:new()

-- =====================
-- 红方
-- =====================
Ch:addPiece(Rook:new(Ch.wR1))
Ch:addPiece(Knight:new(Ch.wN1))
Ch:addPiece(Bishop:new(Ch.wB1))
Ch:addPiece(Queen:new(Ch.wQ))
Ch:addPiece(King:new(Ch.wK))
Ch:addPiece(Bishop:new(Ch.wB2))
Ch:addPiece(Knight:new(Ch.wN2))
Ch:addPiece(Rook:new(Ch.wR2))
Ch:addPiece(Pawn:new(Ch.wP1))
Ch:addPiece(Pawn:new(Ch.wP2))
Ch:addPiece(Pawn:new(Ch.wP3))
Ch:addPiece(Pawn:new(Ch.wP4))
Ch:addPiece(Pawn:new(Ch.wP5))
Ch:addPiece(Pawn:new(Ch.wP6))
Ch:addPiece(Pawn:new(Ch.wP7))
Ch:addPiece(Pawn:new(Ch.wP8))

-- =====================
-- 黑方
-- =====================
Ch:addPiece(Rook:new(Ch.bR1))
Ch:addPiece(Knight:new(Ch.bN1))
Ch:addPiece(Bishop:new(Ch.bB1))
Ch:addPiece(Queen:new(Ch.bQ))
Ch:addPiece(King:new(Ch.bK))
Ch:addPiece(Bishop:new(Ch.bB2))
Ch:addPiece(Knight:new(Ch.bN2))
Ch:addPiece(Rook:new(Ch.bR2))
Ch:addPiece(Pawn:new(Ch.bP1))
Ch:addPiece(Pawn:new(Ch.bP2))
Ch:addPiece(Pawn:new(Ch.bP3))
Ch:addPiece(Pawn:new(Ch.bP4))
Ch:addPiece(Pawn:new(Ch.bP5))
Ch:addPiece(Pawn:new(Ch.bP6))
Ch:addPiece(Pawn:new(Ch.bP7))
Ch:addPiece(Pawn:new(Ch.bP8))

Fk:loadTranslationTable {
  ["#NChessStart"] = "== %arg(<font color='#00868B'><b>白方</b></font>) 对 %arg2(<b>黑方</b>) ==",
  ["#NChessMove"] = "%arg  %arg2 %arg3",
  ["nchess_white"] = "<font color='#00868B'><b>白方</b></font>",
  ["nchess_black"] = "<font color='black'><b>黑方</b></font>",
  ["#NChessOver"] = "-----------------<br>对局结束，%arg（%arg2）获胜，共进行 %arg3 个回合",
  ["NChessTurnStart"] = "<br>回合 %arg --------------",
  ["#NChessForceDraw"] = "-----------------<br>对局结束，【平局】 %arg（%arg2）逼和",
  ["NChessRequestArmistice"] = "%arg（%arg2）提议和棋",
  ["NChessAgreeArmistice"] = "%arg（%arg2）同意和棋，双方议和平局",
  ["NChessRefuseArmistice"] = "%arg（%arg2）拒绝和棋，双方继续",

  ["armistice"] = "提议和棋",
  ["Have proposed a draw"] = "已提出和棋，对方执棋时将回应",
  ["You can't proposed a seceond draw"] = "你不能再提出和棋了",
  ["Have copied PEN code"] = "已复制PEN代码到剪贴板",
  ["The opponent proposed a draw"] = "对方提出和棋",
  ["Agree"] = "同意",
  ["Refuse"] = "拒绝",
}

return Ch
